import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from "@/views/LoginView"
import ResgisterView from "@/views/ResgisterView"
import PasswordView from "@/views/PasswordView"


Vue.use(VueRouter)

const routes = [
  {path:'/',redirect:'/login'},
  // 主界面
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children: [
      //用户管理
      {
        path: '/home/user',
        name: 'UserView',
        component: () => import("../components/global/mxs/UserView")
      },
      //角色管理
      {
        path: '/home/role',
        name: 'RoleView',
        component: () => import("../components/global/mxs/RoleView")
      },
      //菜单管理
      {
        path: '/home/permission',
        name: 'permission',
        component: () => import("../components/global/mxs/PermissionView")
      },
      {
        path: '/home/annountCement',
        name: 'annountCement',
        component: () => import("../components/global/mxs/AnnountView")
      },
      {
        path: '/home/sysMessageTemplateList',
        name: 'Template',
        component: () => import("../components/global/mxs/TemplateView")
      },
      {
        path: '/home/sysMessageList',
        name: 'ListView',
        component: () => import("../components/global/mxs/ListView")
      },
      //申某负责区域开始
      {
        path: '/home/kehu',
        name: 'kehuView',
        component: () => import("../components/global/sqf/KehuView")
      },

      {
        path: '/home/gongying',
        name: 'GongyingView',
        component: () => import("../components/global/sqf/GongyingView")
      },
      {
        path: '/home/cangku',
        name: 'CangkuView',
        component: () => import("../components/global/sqf/CangkuView")
      },
      {
        path: '/home/wuliao',
        name: 'WuliaoView',
        component: () => import("../components/global/sqf/WuliaoView")
      },
      {
        path: '/home/wuliaof',
        name: 'WuliaofView',
        component: () => import("../components/global/sqf/WuliaofView")
      },
      {
        path: '/home/jiangliang',
        name: 'JiangliangView',
        component: () => import("../components/global/sqf/JiangliangView")
      },
      {
        path: '/home/bizhong',
        name: 'BizhongView',
        component: () => import("../components/global/sqf/BizhongView")
      },
      {
        path: '/home/yinghang',
        name: 'YinghangView',
        component: () => import("../components/global/sqf/YinghangView")
      },
      {
        path: '/home/sqf1/one',
        name: 'OneView',
        component: () => import("../components/global/sqf/sqf1/OneView")
      },
      {
        path: '/home/sqf1/two',
        name: 'TwoView',
        component: () => import("../components/global/sqf/sqf1/TwoView")
      },
      {
        path: '/home/sqf1/three',
        name: 'ThreeView',
        component: () => import("../components/global/sqf/sqf1/ThreeView")
      },
      {
        path: '/home/sqf1/purprepayment',
        name: 'purPrepaymentView',
        component: () => import("../components/global/sqf/sqf1/purPrepaymentView")
      },
      {
        path: '/home/sqf1/purpayment',
        name: 'purPaymentView',
        component: () => import("../components/global/sqf/sqf1/purPaymentView")
      },
      {
        path: '/home/sqf1/otherpayment',
        name: 'OtherPaymentView',
        component: () => import("../components/global/sqf/sqf1/OtherPaymentView")
      },
      {
        path: '/home/sqf1/cgreport',
        name: 'CgreportView',
        component: () => import("../components/global/sqf/sqf1/CgreportView")
      },
      //申某负责区域结束
      // 首页
      {
        path: '/home/shouye',
        name: 'ShouYeView',
        component: () => import("../components/global/zxh/ShouYeView")
      },
      // 库存管理-入库管理-采购入库
      {
        path: '/home/caigouruku',
        name: 'CaiGouRuKu',
        component: () => import("../components/global/zxh/KuCunGuanLi/RuKuGuanLi/CaiGouRuKu"),
      },
      // 库存管理-入库管理-采购退货出库
      {
        path: '/home/caigoutuihuochuku',
        name: 'CaiGouTuiHuoChuKu',
        component: () => import("../components/global/zxh/KuCunGuanLi/RuKuGuanLi/CaiGouTuiHuoChuKu"),
      },
      // 库存管理-入库管理-盘盈入库
      {
        path: '/home/panyingruku',
        name: 'PanYingRuKu',
        component: () => import("../components/global/zxh/KuCunGuanLi/RuKuGuanLi/PanYingRuKu"),
      },
      // 库存管理-入库管理-涨库入库
      {
        path: '/home/zhangkuruku',
        name: 'ZhangKuRuKu',
        component: () => import("../components/global/zxh/KuCunGuanLi/RuKuGuanLi/ZhangKuRuKu"),
      },
      // 库存管理-入库管理-其他入库
      {
        path: '/home/qitaruku',
        name: 'QiTaRuKu',
        component: () => import("../components/global/zxh/KuCunGuanLi/RuKuGuanLi/QiTaRuKu"),
      },
      // 库存管理-出库管理-销售出库
      {
        path: '/home/xiaoshouchuku',
        name: 'XiaoShouChuKu',
        component: () => import("../components/global/zxh/KuCunGuanLi/ChuKuGuanLi/XiaoShouChuKu"),
      },
      // 库存管理-出库管理-销售退货入库
      {
        path: '/home/xiaoshoutuihuoruku',
        name: 'XiaoShouTuiHuoRuKu',
        component: () => import("../components/global/zxh/KuCunGuanLi/ChuKuGuanLi/XiaoShouTuiHuoRuKu"),
      },
      // 库存管理-出库管理-盘亏出库
      {
        path: '/home/pankuichuku',
        name: 'PanKuiChuKu',
        component: () => import("../components/global/zxh/KuCunGuanLi/ChuKuGuanLi/PanKuiChuKu"),
      },
      // 库存管理-出库管理-其他出库
      {
        path: '/home/qitachuku',
        name: 'QiTaChuKu',
        component: () => import("../components/global/zxh/KuCunGuanLi/ChuKuGuanLi/QiTaChuKu"),
      },
      // 库存调拨
      // 成本调整
      // 库存盘点
      // 实时库存
    ]
  },
  // 登陆界面
  {
    path: '/login',
    name: 'login',
    component: LoginView
  },
  //注册页面
  {
    path: '/resgister',
    name: 'resgister',
    component: ResgisterView
  },
  //忘记密码页面
  {
    path: '/password',
    name: 'password',
    component: PasswordView
  },


  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
